<?php

namespace models;

class _SkyCMSModel extends \libs\model{
    
    public function __construct($options,$request) 
    {    
        parent::__construct($options);
        
        $logReq = true;
        if($request == '/login' || $request == '/login/result')
        {
            $logReq = false;
        }
        
        $this->options = $options;
        $this->_logReq = $logReq;
        
        $this->loginCheck('login');
    }
    
    
    public function loginCheck($direction)
    {
        if($this->_logReq == true && $_SESSION['loggedIn'] != true) 
        {
            header("Location: ".URL. '_SkyCMS/'. $direction);
        }
    }
    
}

?>
